package com.ly.mpayment.persist.socket.send;
 
import java.net.InetSocketAddress;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.ly.mpayment.persist.socket.WebSocketUtil;



/**
 * socket 服务
 * @ClassName: SocketServer 
 * @Description: TODO 
 * @date Aug 12, 2013 4:23:14 PM 
 *
 */
public class SocketServer {
	private final Log log = LogFactory.getLog(SocketServer.class);

	
	@Autowired
	private SocketHandler socketHandler;
	
	/**
	 * 端口号，spring中可配，默认6000
	 */
	private int port;
	/**
	 * 连接超时时间，spring中可配，默认20分钟
	 */
	private long connectionTimeOut;
	/**
	 * 连接空闲时间，spring中可配，默认30分钟
	 */
	private long idleTimeout;
 
	
	/**
	 * 运行服务器
	 */
//	@Override
	public void run() {
//		InetSocketAddress address = new InetSocketAddress(this.port);  
//        WebSocketUtil socket = new WebSocketUtil(address);  
//        socket.start();//启动websocket服务器进程  
//		log.info("服务器启动成功");
//		log.info("服务器端口："+this.port);
	}
	
	
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	public long getConnectionTimeOut() {
		return connectionTimeOut;
	}
	public void setConnectionTimeOut(long connectionTimeOut) {
		this.connectionTimeOut = connectionTimeOut;
	}
	public long getIdleTimeout() {
		return idleTimeout;
	}
	public void setIdleTimeout(long idleTimeout) {
		this.idleTimeout = idleTimeout;
	}

}
